package jianghongxue.controller;

import jianghongxue.entity.JHXEntity;
import jianghongxue.service.JHXService;

import javax.annotation.Resource;
import java.util.List;
//1
public class JHXController {
    List<JHXEntity> list = null;

    String name = null;
    @Resource
    JHXService jhxservice;

    public String queryPage(){
        list =jhxservice.queryPage(name);
        return "queryPage";
    }

    public String showAll(){
        list =jhxservice.showAll();
        return "showAll";
    }
    //@Resource @Autowired 作用相同 去spring容器中到bean实例
    //@Service @Component 向spring 容器中放入bean（类的对象）实例


    public List<JHXEntity> getList() {
        return list;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setList(List<JHXEntity> list) {
        this.list = list;
    }
}
